﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using ClientController;

namespace Wilke4
{
    public partial class PasswordWindow : Window
    {
        Cls_ClientController systemController;
        MainWindow main;

        public PasswordWindow(MainWindow main, Cls_ClientController systemController)
        {
            this.main = main;
            this.systemController = systemController;
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            systemController.HideTaskBar();
            txtPassword.Focus();
        }

        private void btnGo_Click(object sender, RoutedEventArgs e)
        {
            if (main.CheckPassword(txtPassword.Password))
            {
                systemController.ShowTaskBar();
                systemController.UnblockProcesses();

                this.Close();
            }

            else
            {
                txtPassword.Password = "";
                txtPassword.Focus();
            }
        }
    }
}
